﻿#ifndef TREEINFOITEM_H
#define TREEINFOITEM_H

#include <QWidget>
#include <QMenu>
#include <QTreeWidgetItem>
#include <QtDebug>
#include <QMouseEvent>

namespace Ui {
class TreeInfoItem;
}


//这个类是家族树形图时的树节点item
class TreeInfoItem : public QWidget
{
    Q_OBJECT

public:
    explicit TreeInfoItem(QMenu* itemMenu, QWidget *parent = nullptr);
    ~TreeInfoItem();
    void setIdM(int id);
    void setIdW(int id);
    void setNameM(QString name);
    void setNameW(QString name);
    QString nameM();
    QString nameW();
    int getIDM();
    int getIDW();
    void clear();
protected:
    void mouseDoubleClickEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
private:
    Ui::TreeInfoItem *ui;
    QMenu* menu;
    int idM;
    int idW;

    void freshItem();
};

#endif // TREEINFOITEM_H
